<!DOCTYPE html>
<html>
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<META HTTP-EQUIV="pragma" CONTENT="no-cache">
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
	<META HTTP-EQUIV="expires" CONTENT="0">

	<title>检测终端</title>

	<link rel="stylesheet" type="text/css" href="js/easyui/themes/bootstrap/easyui.css">
	<link rel="stylesheet" type="text/css" href="js/easyui/themes/icon.css">

	<script type="text/javascript" src="js/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="js/extEasyUI.js?v=201305241044" charset="utf-8"></script>
	<script type="text/javascript" src="js/extJquery.js?v=201305301341" charset="utf-8"></script>

	<style type="text/css">
		html,body {
			height: 100%;
			margin: 0;
			border: 0;
			overflow: hidden;
			padding: 0;
		}
		
		#header {
			fit: true;
			margin: 0px;
			border: 0px;
			overflow: hidden;
			padding: 0px 8px;
			vertical-align:middle;
			line-height:48px;
			color:#FFFFFF;
			font-size: 18px !important;
			font-weight:bold;
			background: #0070a6;
		}
		
		#footer {
			height: 32px;
			margin: 0px;
			border: 0px;
			overflow: hidden;
			padding: 0px;
			vertical-align:middle;
			line-height:32px;
			font-size: 12px !important;
			text-align:center;
			color:#FFFFFF;
			background: #0070a6;
		}
	</style>


	<script type="text/javascript">

		$(function() {

			var treeData = [
							{"id":1,"text":"系统配置", "url":"pages/boss.html",
								"children":
									[
										 {"id":4,"text":"系统参数", "url":"pages/run.html"},
										 {"id":14,"text":"PCIE8622","url":"pages/pcie8622.html"},
										 {"id":22,"text":"数据文件","url":"pages/storeFiles.html"},
										 {"id":23,"text":"日志文件","url":"pages/logFiles.html"},
										 {"id":33,"text":"数据模拟","url":"pages/simulator.html"},
										 {"id":4,"text":"登陆管理", "url":"pages/security.html"},
									 ]
							}];
			

			$('#index_tabs').tabs({
				fit : true,
				border : false,
				tools : [ {
					iconCls : 'icon-reload',
					handler : function() {
						var index_tabs = $('#index_tabs');
						var href = index_tabs.tabs('getSelected').panel('options').href;
						if (href) {/*说明tab是以href方式引入的目标页面*/
							var index = index_tabs.tabs('getTabIndex', index_tabs.tabs('getSelected'));
							index_tabs.tabs('getTab', index).panel('refresh');
						} else {/*说明tab是以content方式引入的目标页面*/
							var panel = index_tabs.tabs('getSelected').panel('panel');
							var frame = panel.find('iframe');
							try {
								if (frame.length > 0) {
									for ( var i = 0; i < frame.length; i++) {
										frame[i].contentWindow.document.write('');
										frame[i].contentWindow.close();
										frame[i].src = frame[i].src;
									}
									if (navigator.userAgent.indexOf("MSIE") > 0) {// IE特有回收内存方法
										try {
											CollectGarbage();
										} catch (e) {
										}
									}
								}
							} catch (e) {
							}
						}
					}
				}]
			});

			$('#layout_west_tree').tree({
				data : treeData,
				parentField : 'id',
				onClick : function(node) {
					if (node.url) {
						addTab({
							url : node.url,
							title : node.text,
							iconCls : node.iconCls
						});
					}
				}
			});

		});

		function addTab(params) {
			var iframe = '<iframe src="' + params.url + '" frameborder="0" style="border:0;width:100%;height:99%;"></iframe>';
			var t = $('#index_tabs');
			var opts = {
				title : params.title,
				closable : false,
				iconCls : params.iconCls,
				content : iframe,
				border : false,
				fit : true
			};
			if (t.tabs('exists', opts.title)) {
				t.tabs('select', opts.title);
				//parent.$.messager.progress('close');
			} else {
				t.tabs('close', 0);
				t.tabs('add', opts);
			}
		}

	</script>
	
</head>

<body>

	<div class="easyui-layout" data-options="fit:true">
	
		<div data-options="region:'north',border:false" style="height:48px;">
			<div id="header">检测终端</div>
		</div>
		
		<div data-options="region:'south',border:false" style="height:32px;">
			<div id="footer">上海凯工公司</div>
		</div>
		
		<div data-options="region:'west',title:'配置项',split:false" style="width:220px;">
			<ul id="layout_west_tree"></ul>
		</div>
		
		<div data-options="region:'center',border:false">
			<div id="index_tabs" style="overflow: hidden;" draggable="false">
			</div>
		</div>
		
	</div>

</body>
</html>